package org.dashboard.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dashboard.bean.AdAuthorization;

import java.util.List;

@Mapper
public interface AdAuthorizationMapper {
    int deleteByPrimaryKey(Integer authorizationId);

    int insert(AdAuthorization record);

    int insertSelective(AdAuthorization record);

    AdAuthorization selectByPrimaryKey(Integer authorizationId);

    int updateByPrimaryKeySelective(AdAuthorization record);

    int updateByPrimaryKey(AdAuthorization record);

    List<AdAuthorization> queryRoleResources(@Param("roleId") Integer roleId, @Param("resourceType") Integer resourceType);

    int checkUserHasResources(@Param("userId") Integer userId, @Param("resourceId") Integer resourceId, @Param("resourceType") Integer resourceType);

    int deleteByRoleIdResourceType(@Param("roleId") Integer roleId, @Param("resourceType") Integer resourceType);
}